This invention is directed to an improved circuit for rotating a digital image any multiple of 90 degrees by bit shifting the lines of an image, storing them into a buffer memory, reading them out in a different order and bit shifting again, almost all of the transfers to and from memory being in the fast page mode.
The basic circuit has been described in U.S. patent application Ser. No. 07/453,738, Method To Rotate a Bitmap 90 Degrees, now U.S. Pat. No. 5,111,192, and a more detailed description of the addressing details is contained in application Ser. No. 07/721,797, Parallel Rotation Algorithm, both of which are incorporated by reference herein.
The basic system of rotating a block of an image requires first that each line of each block of the image be circularly shifted by the line number within the block and then stored in a buffer memory. For example, line 0 is circularly shifted 0 bits, line 1 is circularly shifted 1 bit, etc. At this point, the image can either be read out of the buffer and not rotated at all, or read out in such a way that the final image is rotated by any multiple of 90 degrees, including all mirror images.
To get back the original orientation, the image is read out one line at a time, and is simply shifted back to its original form. To get a rotated image, the image block is read out from the buffer along diagonal lines, and circularly shifted again.
When reading in image data to the buffer, the fast page mode can be used. This is a feature designed into memory devices, and provides that the data can be stored or read out at a higher speed provided that the row address does not change from one access to the next. For example, when reading words into a buffer, assume that the data is read into row 0 col 0, row 0 col 1, row 0 col 2, etc. Since the row address does not change, the fast page mode can be used, and the total data transfer can be done in a fraction of the time that it would otherwise take. The column addresses need not be sequential, as long as the row address is constant.
Similarly, to take data out of the buffer in non-rotated form, the procedure is simply the reverse of the loading procedure, and that can also be handled in the fast page mode.
The problem occurs when reading from the buffer in the rotation mode. Here the bits are taken from row 0 col 0, then row 1 col 0, then row 2 col 0, etc. Here the fast page mode can not be used because the row address is different for each read, and therefore the production of a rotated image will take significantly longer than the production of one that is not rotated. There is a need, therefore, for an improved circuit that will produce both rotated and unrotated images at speeds approximating that of the fast page mode.